<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<include file="Public:meta" />
	<style>
		label{	color:#00F; 	line-height:21px; 	font-weight:bold; 	height:21px; 	vertical-align:middle;	font-size:12px;}
		.CouponType1{ font-weight:bold; color:#0000FF}
		.CouponType2{ font-weight:bold; color:#F0F;}
	</style>
</head>
<body id="main_page">
<div class="container"> 
       <form enctype="multipart/form-data"  method="post" id="frm">
                	<input type="hidden" name="p" value="{$NowPage}" />
                    <div class="table">
                    <div class="toolbars">
                        <li class="toolbar"><a id="selectall" onclick="CheckAll()"  title="全选">全选</a></li>
                        <li class="toolbar"><a id="del" onclick="BatchDel()" title="批量删除">删除</a></li>
                        <li class="toolbar toolbarform">
                        	<label>优惠券名称：</label>{$Coupon.CouponName}
                            <label style="padding-left:20px">优惠券面额：</label><span style="color:red;">{$CurrencySymbol}{$Coupon.CouponMoney}</span>
                        </li>
                    </div>
                    <table class="datatable" id="datatable">
                    <tr>
                        <th width="35px"  nowrap="nowrap">选中</th>
                        <eq name="Coupon.CouponType" value="1">
                        	<th width="150px" >优惠券</th>
                        <else/>
                        	<th width="100px" >优惠券码</th>
                        </eq>
                        <th>使用会员</th>
                        <th width="180px">订单编号</th>
                        
                        <th width="125px" >使用时间</th>
                        <th width="70px">操作</th>
                    </tr>  
            <notempty name="Data">                
                <volist name="Data" id="d">
                    <tr>
                        <td><empty name="d.OrderNumber"><input class="checkrow" type="checkbox" name="id[]" value="{$d.CouponSendID}" /></empty></td>
                        <td><eq name="Coupon.CouponType" value="1">{$Coupon.CouponName}<else/>{$d.CouponCode}</eq></td>
                        <td>{$d.MemberName}</td>
                        <td>{$d.OrderNumber}</td>
                        <td>{$d.OrderTime|strtotime|yd_friend_date}</td>
                        <td  style="text-align:left"><empty name="d.OrderNumber"><a onclick="Del({$d.CouponSendID})" class="btnDel">删除</a></empty></td>
                    </tr>
                </volist>
            <else/>
                <tr><td colspan="6" id="NoData">{$Think.lang.NoDataTip}</td></tr>
            </notempty>                                
            </table>
         <div class="tfoot">
              <div class="page"><span class="pagesize">每页<span class="pz">{$AdminPageSize}</span>条</span>{$Page}</div>
         </div>
                </div>
</form>
</div>
</body>
</html>
<script type="text/javascript">
//查询
function Search(){
	$('#frm').attr("action", "__URL__/index");
	$('#frm').submit();
	return true;
}	

function Edit(id){
	url = "{$Url}modify/id/"+id;
	location.href = url;
}

function Del(id){
	$.confirm("{$Think.lang.DeleteTip}", function () {
		url = "{$Url}delCouponSend/id/"+id+"/p/{$NowPage}";
		location.href = url;
	}, function () {
		return true;
	});
}

function BatchDel(){
	var arrChk = $("input[name='id[]']");
	var n = 0;
	for(var i = 0; i < arrChk.length; i++){
		if(arrChk[i].checked) n++;
	}
	
	if( n == 0 ) {
		WarnBox("{$Think.lang.CheckDeleteTip}");
		return;
	}
	
	$.confirm("{$Think.lang.DeleteTip}", function () {
		$('#frm').attr("action", "__URL__/delCouponSend");
		$('#frm').submit();
	}, function () {
		return true;
	});
}
</script>